class CreateMaps < ActiveRecord::Migration
  def self.up
    create_table :maps, :id => false do |t|
      t.integer :from_fragment_id
      t.string :from_local_key

      t.integer :to_fragment_id
      t.string :to_local_key

      t.integer :user_id
      t.integer :mapping_type_id
      t.text :comments
      t.boolean :is_imported, :default => false

      t.timestamps
    end

    add_index :maps, :from_fragment_id
    add_index :maps, :from_local_key
    add_index :maps, :to_fragment_id
    add_index :maps, :to_local_key
  end

  def self.down
    drop_table :maps
  end
end
